A network switch, which is one of relay devices, searches for and registers a MAC address by accessing all memories (hereinafter referred to as RAMs) when accessing a MAC address table (hereinafter referred to as MADT).
FIG. 12A and FIG. 12B show schematic diagrams of a relay device according to the related art. The related art relay device obtains a MAC address attached to transmission data transmitted from outside, and then calculates a hash key on the basis of the obtained MAC address. Thereafter, a MADT access engine in the relay device searches all RAMs of MADT that is constituted by a plurality of RAMs by using the calculated hash key, and obtains a data pair formed of a transmission destination MAC address and a transmission destination port number. Thereafter, the MAC address obtained from outside and the MAC address searched from the MADT are compared with each other. When they match each other, transmission data is outputted via a physical port corresponding to the transmission destination port number searched from the MADT.
The relay device shown in FIG. 12A performs the above operation of the MAC address by using only the MADT, and the relay device shown in FIG. 12B performs the above operation more quickly by having a small MADT (hereinafter referred to as SMADT) in which a plurality of flip-flops (hereinafter referred to as FFs) are used as a storage section in addition to the MADT and by using the SMADT as a cache. In the relay device shown in FIG. 12B, the MAC address obtained from outside and a MAC address stored in the FFs are compared with each other by an SMADT access engine, and when they do not match each other, the above processing is performed by using the MADT.
FIG. 13 is a diagram for explaining an internal structure of the RAM constituting the MADT. The example shown in FIG. 13 is an example constituted by four RAMs (a four way arrangement). As shown in FIG. 13, each RAM included in the MADT is organized into storage areas each of which has a predetermined size, i.e., is configured to store a predetermined number of words. Each of the divided storage areas can store a data pair formed of a MAC address and a transmission destination port number.
A related art relay device accesses all the RAMs regardless of whether or not valid data is stored in the RAMs.